package www.dianbaozu.com.ui.my

import android.os.Bundle
import android.view.View
import www.dianbaozu.com.R
import www.dianbaozu.com.databinding.FragmentAboutTelegraphGroupBinding
import www.wen.com.common.lib.base.fragment.BaseVMFragment
import www.wen.com.common.lib.data.entities.ContractEntity
import www.wen.com.common.lib.extension.nav
import www.wen.com.common.lib.helper.loading.KeyHelper
import www.wen.com.common.lib.helper.loading.TitleBarUniversalAdapter
import www.wen.com.common.lib.util.LocalInfoUtil

/**
 * @author WEN
 * @Description: 关于电报组
 * @date 2020//25 17:48
 */
class AboutTelegraphGroupFragment : BaseVMFragment<FragmentAboutTelegraphGroupBinding>() {

    override fun isEnableLoadingHelper(): Boolean = true

    override fun getTitleBarUniversalAdapter(): TitleBarUniversalAdapter =
        TitleBarUniversalAdapter(requireActivity(),tilte = "关于电报组",action = ::titleAction)

    override fun getLayoutId(): Int = R.layout.fragment_about_telegraph_group

    override fun lazyInitView() {
        dataBinding.tvVersion.text = LocalInfoUtil.getLocalVersionName(requireContext())
    }

    override fun onClick(v: View) {
        when(v.id){
            R.id.strUserAgreement -> {
                nav(R.id.action_aboutUsFragment_to_contractFragment, args = Bundle().apply {
                    putParcelable(KeyHelper.BUNDLE_DATA, ContractEntity("用户协议", "用户协议"))
                })
            }

            R.id.strPrivacyAgreement -> {
                nav(R.id.action_aboutUsFragment_to_contractFragment, args = Bundle().apply {
                    putParcelable(KeyHelper.BUNDLE_DATA, ContractEntity("隐私政策", "隐私政策"))
                })
            }
        }
    }

}



